<?php

require_once 'PipesImpl/Namespace/Parser.php';
require_once 'Pipes/Namespace.php';

class Pipes_Namespace_Parser implements PipesImpl_Namespace_Parser 
{
    private $_namespace = '';
    private $_name = '';
    
    public function __construct() 
    {
        
    }
    
    public function parse($name) 
    {
        $explodedName = explode(':', $name);
        $namespace = array_shift($explodedName);
        $name = (count($explodedName) > 0) ? array_shift($explodedName) : $namespace;
        
        return new Pipes_Namespace($namespace, $name);
    }
}

